package controllers

import (
	beego "github.com/beego/beego/v2/server/web"
)

type CommonController struct {
	beego.Controller
	Templatetype string //后台ui template type
}

var ApiToken, _ = beego.AppConfig.String("apiToken")

func (this *CommonController) Rsp(status bool, str string) {
	this.Data["json"] = &map[string]interface{}{"status": status, "info": str}
	this.ServeJSON()
}

func (this *CommonController) GetTemplatetype() string {
	templatetype, _ := beego.AppConfig.String("template_type")
	if templatetype == "" {
		templatetype = "xadmin"
	}
	return templatetype
}
